var http = require('http');
var express = require('express');
var path = require('path');
var app = express();

var mongoose = require('mongoose');
mongoose.connect('mongodb://localhost:27017/courseApp');

app.set('port', process.env.PORT || 3000);
app.use(express.logger('dev'));
app.use(express.bodyParser());
app.use(express.cookieParser());

app.get('/', function(req, res){
	res.sendfile('index.html');
});

http.createServer(app).listen(app.get('port'), function(){
	console.log('Server running on ' + app.get('port'));
});